﻿using System;
using System.Web.UI.WebControls;
using BLL;

public partial class ProductPCBAging_ManagePCBAging_LatestCategory : System.Web.UI.Page
{
    private PCBAging ag;

    public ProductPCBAging_ManagePCBAging_LatestCategory()
    {
        ag = new PCBAging(); 
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        BindPCBAging();
    }

    protected void BindPCBAging()
    {
        this.GridView1.DataSource = ag.GetLatestPCBAging();
        this.GridView1.DataBind();
        for (int i = 0; i < GridView1.Rows.Count; i++)
        {
            DateTime dt = DateTime.Parse(GridView1.Rows[i].Cells[1].Text);
            if (dt.Hour < 8 || dt.Hour > 19)
                GridView1.Rows[i].Cells[1].ForeColor = System.Drawing.Color.DodgerBlue;
        }
    }

    protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
        this.GridView1.PageIndex = e.NewPageIndex;
        BindPCBAging();
    }
}
